/*
 * @Author: zhouting qczhouting@yonyou.com
 * @Date: 2022-07-06 14:52:37
 * @LastEditors: zhouting qczhouting@yonyou.com
 * @LastEditTime: 2022-09-20 18:06:44
 * @FilePath: \cms_pk1\src\api\customerRepair\customerComplaint\customerComplaintQuery\index.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
/**
 * 客户投诉查询
 *
 * @Author: 刘国强
 * @Date: 2019/8/14
 */
import axios from '@/api/fetch';
import * as types from './types';
import SERVER from '@/api/server';

// 查询投诉接待分页信息
export const queryComplaint = params => axios.get(`${SERVER.DMSCLOUD_CUSTOMERREPAIR}/customer/complaintQuery`, { params });

// 根据投诉编号删除投诉信息
export const delComplaintById = complaintId => axios.delete(`${SERVER.DMSCLOUD_CUSTOMERREPAIR}/customer/complaintQuery/${complaintId}`);

export const acceptComplaintById = complaintId => axios.post(`${SERVER.DMSCLOUD_CUSTOMERREPAIR}/customer/complaintReception/acceptComplaint/${complaintId}`);

// 导出客户投诉处理情况
export const exportComplaint = params => axios.get(`${SERVER.DMSCLOUD_CUSTOMERREPAIR}/customer/complaintQuery/export`, { params, responseType: 'arraybuffer' });

//查询投诉分页信息
export const getComplainList = params => axios.get(`${SERVER.DMSCLOUD_ACTIVITY}/customerComplain/getComplainList`,  { params } );
//查询投诉明细信息
export const getComplainByCcId = params => axios.get(`${SERVER.DMSCLOUD_ACTIVITY}/customerComplain/getComplainByCcId`, { params });
//查询投诉明细操作历史
export const getComplainHistoryLog = params => axios.get(`${SERVER.DMSCLOUD_ACTIVITY}/customerComplainHistory/getComplainHistoryLog`, { params });
//客户投诉（区域经理）响应
export const acceptComplaintResponse = params => axios.post(`${SERVER.DMSCLOUD_ACTIVITY}/customerComplain/submitResponse`,params);
//客户投诉（区域经理）审核
export const acceptComplaintExamine = params => axios.post(`${SERVER.DMSCLOUD_ACTIVITY}/customerComplain/submitExamine`,params);
//导出
export const getListForExport = params => axios.post(`${SERVER.DMSCLOUD_ACTIVITY}/customerComplain/getListForExport`, params, {
  responseType: 'blob'
});
export const getCusForExport = params => axios.post(`${SERVER.DMSCLOUD_ACTIVITY}/customerComplain/getCusForExport`, params, {
  responseType: 'blob'
});

export const getOutExport = params => {
    return axios({
      url:`${SERVER.DMSCLOUD_ACTIVITY}/customerComplain/getListForExport`,
      method: 'post',
      params: params,
      responseType: 'blob'
    });
  };

